import request from '@/utils/request'

export function addRegion(data) {
  return request({
    url: '/juanbusiness/district/add',
    method: 'post',
    data
  })
}

export function findRegion(page,size) {
  return request({
    url: '/juanbusiness/district/findPage',
    method: 'get',
    params: {page: page,size: size}
  })
}

export function findDistrictAllRegion() {
  return request({
    url: '/juanbusiness/district/findDistrictAll',
    method: 'get'
  })
}

export function findLinkRegion(levelType,parentId) {
  return request({
    url: '/juanbusiness/district/findLinkage',
    method: 'get',
    params: {levelType: levelType,parentId: parentId}
  })
}

  export function detailRegion(id) {
    return request({
      url: '/juanbusiness/district/get',
      method: 'get',
      params: {id: id}
    })
  }

export function editRegion(data) {
  return request({
    url: '/juanbusiness/district/edit',
    method: 'put',
    data
  })
}

export function delRegion(id) {
  return request({
    url: '/juanbusiness/district/del',
    method: 'delete',
    params: {id: id}
  })
}
